const express = require("express");
const cors = require("cors");

const app = express();

app.use(express.json());
app.use(express.urlencoded({ extended: false }));

//跨域
app.use(cors());

const router = require("./server/router.js");

//托管静态资源
app.use(express.static('www'))

app.use(router);

//启动服务
app.listen(6543, () => {
    console.log('服务已开启,6543端口被监听...');
})